/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tv.venta.dao;

import java.util.ArrayList;
import java.util.List;
import javax.ejb.Stateless;
import javax.ejb.LocalBean;
import javax.persistence.Query;
import tv.global.dao.BaseDAO;
import tv.venta.vista.Estadistica;

/**
 *
 * @author ctrosch
 */
@Stateless
@LocalBean
public class EstadisticaDAO extends BaseDAO {

    public List<Estadistica> getListaByNroCta(String nroCuenta){

        try {
            String query = "SELECT e FROM Estadistica e WHERE (e.nrocta = :nrocta) ";
            Query q = getEntityManager().createQuery(query);
            q.setParameter("nrocta", nroCuenta);
            return q.getResultList();
        } catch (Exception e) {
            System.err.println("Error al consultar Estadistica:" + e.getMessage());
            return new ArrayList<Estadistica>();
        }
    }
    
    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")
 
}
